The typical approach is to make geometry that matches your background and assign it a material that will catch shadows and GI but be otherwise invisible. Then you’ll want passes for the shadows and the GI, preferably isolated to just the ground. Depending on your software, that might require a separate render with just the floor information. Render layers in Maya or state sets in Max are useful for that.
In the compositing software, you have options for how you want to apply the passes. For shadows, I like to shuffle it into a mask that I use on a color corrector. GI is usually simply added to the background.
Sometimes it is useful to have two shadow passes: one with a sharp shadow and one with a broad, softer shadow. You might also want to render an ambient occlusion pass to strengthen the contact shadow.
If you tell us what software and renderer you’re using, the advice can be more specific.
Oh, and if you’re getting noise in your renders, you probably need to turn up your antialiasing to smooth it out.