As someone has said, it depends on the situation and camera/lens as there isn't one method that works for everything. You gotta experiment a bit to find the way that works best for you.
- Camera on tripod (an absolute must if you want a good shot)
- Aperture F8 or F11 (about the sharpest most lens get and everything will be in focus)
- ISO 100-200 (best quality, least amount of noise in the image)
- 2 second timer on the shutter to stop shake when you press the shutter button
- Shutter speed on auto, so let it work its self out. Aperture priory mode (AV on a canon) works for this. You can manually set the the shutter speed if you want, it will be in the order of 5 - 30 seconds for most dark rooms shots.
- Wiggle your torch about the room while the shutter is open to 'paint' light everywhere you want light.
- Shoot in RAW if you aren't already, you can bring up a lot of detail in the shadows in RAW format that you can't in Jpeg.
If your lens is auto-focus, use a torch to light up the area you are focusing on so the camera can actually focus on it before taking the photo. Otherwise the camera is trying to focus on pitch black and it won't know what to focus on, resulting in a completely out of focus image.
If you want to get more advanced, you can also use HDR bracketing (if you camera has that setting) to get a better dynamic range so highlights and shadows are exposed right, just be careful not to go mad and end up with a horrible puke inducing HDR shot. If done correctly, it shouldn't be obvious that it's a HDR image.