It depends on the year of the M...Depending on the year, procedures have been posted on the web for the 2006-2007 and the 2008-2010 models. I haven't seen any bypass for the 2011 M's yet.
You have to use a switch for the ground and hook up the parking brake wire to it, as well as a switch for the VSS info to fool the car that its not moving.