I haven't had to do this with my boat (yet), but I did it with a car and it worked really well. The windows were left down overnight and it rained, so the carpets got soaked and then mildew started to develop.
I have a small electric forced-air ceramic heater (The Heat Force) that's about 4"Wx4"Dx6"H. I put that inside the car in my unheated garage. With the windows cracked, I ran that heater for a few days and it dried everything right out. I think the heater cost me about $40. Well worth it because I can use it in a variety of places as a space heater. It has a manual/auto switch, fan only/heat switch, a blower fan and dust filter, thermostat (65 to 85 degrees) and a auto-off switch in case it gets knocked over. It's enough of a space heater to heat my office at work when the regular heat is turned off.
If and when my boat gets wet, and its cold outide, I can put this heater in my bilge area and let the warm air circulate below-deck. It will flow out through the various gaps, lids and openings and help dry out the carpet and wood. I could also put my boat cover on, put the heater on the deck and let the warm air dry out the carpet.
Just my .02 worth.
Mark