I did something like that a long time ago, but I didn't finish it (mostly because I can't draw, so it ended up looking like crap anyway).
Basically, it's a matter of drawing the objects in the right order. Draw each object stack bottom up, and do the rear stacks first. Start at the bottom backmost object, then the object on top of that et cetera, then you move towards the front and draw the next stack.
The objects are not real 3D objects in anyway, they are just flat sprites drawn to look like 3D, placed on the screen in a specific order.