If you can manage taking high quality photos in this (the way your examples are shown) kind of layout and good light, you can use selection tools and manual shadows in Photoshop:
- Take photo of the products
- Select the products (discarding shadows) using pen tool (I prefer) and paste them in new layers Cntl+J
- Separately draw shapes for the shadows, each in new layers
- Convert the shadow layers to smart object and lower opacities (in general, the more bright is the light, more opaque should be the shadow. I have kept them at 70% opacity to make them more realistic) and blur them a bit.
- Add additional Drop Shadow (You can do this using Blending Options) for each product and later convert the shadow effect into raster layers using
Layer > Layer Style > Create Layer
. And mask the unnecessary shadow.
- Hide the unnecessary remaining photo areas. Add a solid background of your choice.
- Adjust overall color/temperature/brightness of the composition if you want.
Here's the progress:




Note that it is still highly dependent on the quality of the photos.