Here's how I did mine (with a couple of pictures)
CAUTION: these switches are mounted backwards (see comment below by Crevice Reamer!), they work but would be safer the other way around.[/edit]
Link: limit switches on JGRO
I mounted the limit switches on U shaped aluminium profile (stuck the microswitches on with epoxy) which then fits snugly over square aluminium tube. There is one for each axis and the tubes are screwed down at each end to the machine.
The switches can slide up and down the tube for adjustment, and are then kept in place with a set screw. I thought that some adjustment might be useful, to stop the machine running into hold-down clamps etc, but I haven't adjusted them much in practice.
The switches are tripped by HDPE ramps mounted on L shaped alumiunium angle left over from making the linear bearings.
There are two limit switches per axis, one of these on each axis doubles as a home switch.