Typically these devices (see picture) are soldered to PCBs using reflow techniques, where solder paste is stencilled to the board, robots place the chips and a special oven heats the device till the solder paste melts. Other devices with the same problem include driver chips and high power LEDs.
I originally tried using silver heatsink compound however although it was pretty good thermally it didn't make a reliable electrical connection, the cct malfunctioned with vibration and the magic smoke escaped...leading to much swearing and frustration.
After some experimentation I came up with this method to solder underneath these types of devices for hand prototyping without needing a reflow oven.
Step 1: Prepare thermal vias
First drill small holes (as many as can fit) under where the chip heatsink goes.
Next poke through copper wire through the holes (second picture). Try to use wire as thick as the holes will allow. You need a tight fit. I just used the leads from a diode....they were just right....and made of copper (plated with tin).
Second time around I'd poke the wires from the bottom just enough to poke out, but not too far (third pic).
Step 2: Solder the top and bottom of the thermal via
Trim the top wires as close as possible to the PCB without destroying any trackwork. Leave about 2-3mm of wire poking out from the bottom though.....you need to be able to connect the heat from the soldering iron to something when it comes time to attach the chip.
Step 3: File back the topside
Carefully file as much as possible without scratching surrounding trackwork. Take your time here....it is very difficult and cannot be rushed.
When it gets too close to file, use a scalple blade to scrape away even more. The copper and the solder should be reasonably soft.
In the first picture you should be able to see the cores of the copper wires that were poked through starting to appear.
Step 4: Finally sandpaper the PCB
Don't be too agressive with coarse sandpaper or else you might (as I did) grind away surrounding trackwork. Again take your time, and finish with 2000 grit paper to get a good finish.
Look at the picture, although blurry you should be able to see bare copper with two copper slugs where the wires are.
Also note a couple of scratches on some connecting tracks....oops.....hopefully the tinning will take care of these little scratches.
After this, use some used solder braid to tin the pin tracks where the chip will connect.....but leave the heatsink area bare copper....you may need to remove excess tinning with clean solder braid. It is important to have everything flat.
Step 5: Hurray, the solder paste enters the stage.
When the chip is placed on the PCB, the paste will sploosh out, which might end up shorting out the chips pins.....so only use as much as is needed.
Next place the chip on the PCB, and tack solder the corner pins to the tinned tracks. Use a multimeter to make sure that there are no shorts.
Be careful with solder paste, it is toxic so wash your hands if you get any on yourself and clean any splatters. Also it should be stored in the fridge when not in use.
When tacking on the corner pins, rely on the tinned trackwork....don't add any more solder. You just need to hold the chip in position. You should have a little play when moving the chip slightly. If you put too much in, remove everything, clean and try again.
Step 6: Heat from underneath
Watch the topside of the board and notice that there should be a little bit of fumes as the solder paste melts and fluxes.
When cooled, nudge the chip. It should be rock solid if the paste has melted and solidified. If there is any play....then try heating again, or else remove everything/clean and try again.
Finally solder the remaining pins and the previously tacked pins and clean up with clean braid then flux remover and test for shorts.
Congratulations you've successfully attached a chip with a heatsink underneath both thermally and electrically.
Sorry about the blurry pics, my camera only just does macro.
This technique should be useful for not only chips as shown in the pictures, but also high power LEDs and any other components with a similiar need for a good electrical and thermal connection to PCB layouts.