I did a project like this a while back. What I had was a two-barreled robotic gun firing from a compartment in a wall.
Anyway, what I did for the flash was very simple at the time, but looking back, I think I'd still do it again today. I made a funky NURBS object in the shape of your typical "flash" and stuck one at the end of the barrels. I then gave it a nice glowing shader, and used Set Driven Key to make it invisible when the barrel was retracted, but visible when extended. I also put a simple rotation expression on it to make it rotate slowly, so the flash wasn't the exact same shape every time it was visible.
For the shells, I used particle instancing and dynamics to have the shells bounce off the ground. I'll post a pic of what I made if I can find it.