Muzzle flash usually stock footage, or cloned in from the source. You can get pretty creative in creating it, do a matte painting in PS against a blue or black BG and then add or key over your footage. The flash lasts for only one frame, and machine gun fire is discontious single flashes.
A little something, muzzle flash is rarely seen in hte real world as it is in the movies, also, different bullets/gunpowder make different color flashes...so, a little research will add to the realism. A little smoke wisp and a shell ejecting helps as well. The most important thing to keep in mind is the interactive light from the flash. Depending on your lighting conditions this will vary, so studying your footage is very important in this aspect. If it's brighter outside, less interactive light, if it's a dark room it will be a big flash of light that lights up everything.
For bullets flying around there are many solutions to this problem, CG, photo's, etc. It really depends on the shot. If you want see bullets flying around in realtime, then that's the easiest part...they can't be seen! If you want to see them in slow mo that's when you'll need alternative solutions.