There's no trick - you don't even try to do it. It is virtually impossible. No matter how closely you align the rotation, it always twists a slight bit when it starts going in.
If you're installing a 3-lug mp5 barrel, rotate the barrel 120 degrees from the original slot, press it in, then redrill a new hole.
If you're doing a 93 or 91 barrel, you could go 120 degrees, or 180 degrees.
Before drilling the new hole, you have to start it with an endmill so the hole isn't starting on a curved surface. Drill it through at 3/16", then ream it so it's about .002" smaller than your barrel pin. The standard barrel pins are .1970", so a .1950"-.1955" hole should be about right.
If you screw it up and make the hole a thou or two too large, all is not lost. Just order some hardened gage pins that will give you a .0015"-.002" interference fit. Grind them to length, chamfer the edge, and press it in. You can even dimple the ends with a dremel and nobody would ever know the difference.