You must start by cutting out the background from the object that you want to cast the shadow. When you have done this you duplicate the layer that you have the object in, call it shadow to make it easy to work with. Place the shadow layer underneath the object layer.
Now you want the shadow to become lighter the further away from the object it is. To achieve this effect you need to add a Layer Mask to the shadow layer. Select the shadow layer and press the Add layer mask button at the bottom of the Layers Window . Use the Gradient Tool to draw a gradient from white to black, where black should be in the position where you want the shadow to be the softest.
You might have to move the shadow to make it look like it origins from the object, when you have aligned it perfect to the object you are done and it could look like the image you can see to the right.