That is the situation I faced when mounting a Raspberry Pi to a base. This was a revision B model with no mounting holes. Lego to the rescue.
Others have used Lego components as standoffs or spacers (see Lego Standoffs). However, the ones I have seen either are used in applications where mounting holes exist, or involve simply drilling a hole through the side of a Lego brick and using it as a spacer. Not very elegant.
The standoffs described in this Instructable can be used to mount circuit boards with our without mounting holes and look pretty good too.
Step 1: Fabrication of Lego Standoffs
Note: These instructions are for use with 3 mm metric mounting screws. If you wish to use ANSI screws, use 4-40 and a #31 or #32 drill for the holes in the bricks. A 1/8 in (0.125 in) drill works well for the clearance holes in the mounting base.
(1) Hold the brick with a pair of pliers and drill a 3 mm hole through the center of the Lego snap post. This works best using a hand drill and going through the underside of the brick, where a preexisting hole left from the molding process leaves a small blind hole that is perfect for guiding the drill through the center of the snap post (Figure 1).
(2) Hold the brick next to the circuit board to gauge how thick the snap post must be. It needs to be slightly shorter than the width of the circuit board.
(3) Rub the post against a piece of sandpaper (180-220 grit works fine) to remove material until the desired post thickness is achieved (Figure 2).
Note: Rotate the brick around as you sand to try and get the post height to be the same all around.
The standoff is ready to use.