Mouthpieces are turned on a lathe. See Robb Stewart with Old's old school lathe here:
http://rouses.net/trumpet/oldslathe.htm
The mouthpiece blank turns at a very high speed while the cutter carves the shape into the metal. Mouthpieces are still made the same basic way today, but the lathes are controled by computer so the shape and size is more precise and consistent (CNC lathes, Computer Numerically Controlled).