To achieve the transparency you need to combine volumetric scatter into the material - in place of the usual 'diffuse' shader.

The key to the transparency is to model the "chocolate" to that it has very thin layers over the "nuts".
I started by modelling the nuts :

Then added the chocolate (just a cube, rescaled), subdivided and used Sculpt mode to build up the chocolate around the nuts.

The material to include surface properties (the bumpiness and glossiness) along with the translucency is as follows :

Adjust the Density (the Value node) to vary the opaqueness of the chocolate. This is essentially just the same as a volumetric shader that you would use for a liquid - just with a higher density to make it appear more solid.
For best results, take care over the sculpting of the chocolate over the embedded nuts - you need consistently thin layers to get smooth transitions.
Blend file included 