What you want are Render Layers. A render layer is basically what layers are rendered to separate images, composited later in the compositor after the actual render takes place. It is possible to do this fairly easily actually.
First, make sure they are on different layers (I think you said they already are). Then go to Properties > Render Layers and set up the default Render Layer to only show your background object layer:
The Layer section is to show what layers to render, and the Exclude section is for what sections to exclude from the render (shadows, reflections, lamps, etc.). It is important you get these right.
Once you have that set up, you can add a Render Layer for the foreground object. Press the + beside the Render Layers display window, and name as desired:
Now set up the new layer using the same principles as the first, isolating the foreground element. You should get two images when you press F12 now:
Now we need to go into the Compositor to put the two images together.
Start by adding another Render Layer input:
Now set up your nodes like this:
You can see that now it is combining the two different rendered images based on the Alpha value of the second. One more iportant thing you need to do: Make sure that there is an Alpha value to use. Go to Properties > Render > Film and tick the Transparent checkbox: