Have a look at moodi.org, sony.com/be-moved, http://www.spaceneedle.com/home/, . How can i make site like this?
Basically, it's all done by detecting user's scrolling amount, and moving things accordingly.
You need some JavaScript and of course html & css to achieve something like that.
What JS does is that it detects if user is scrolling, it's direction and speed, then tells object "A" to move at the opposite direction of scroll, and also at 0.8 speed of it. Object "B" moves at the opposite direction but with 1.2 speed of scrolling, so You'll feel like object "B" is closer to you.
This is just a very simple example on how it works.
Remember to have a good scenario before touching the code, and while coding, break your problems into small pieces and look for them in here, For example: How to change position of absolute element based on client scrollTop? That's how you'll learn.
There are many technics, to make something efficient and clean, you need to be familiar with them to make the best decision. Here are some links which help you start:
These are just some starting points, of course you can find more tutorials and even look through source of your favorite websites to see how they achieved the effect.
Final note : I think one important thing to bear in mind is not to move many objects at the same time, once they are off the viewport, stop moving them, this helps a lot when it comes to performance specially on older machines. jQuery Waypoint is a handy tool, which is introduced in the second link.