Last night in my Seriously Fun Photography class we tried balancing on-camera flash and ambient light. A few notes on that:
1. First, let's set a manual exposure based on the ambient light available. For example, in the low-light conditions of a classroom at night, we found a reasonable exposure was around a sensitivity setting of ISO 1600, a shutter speed of 1/60th and an aperture of F/5.6. I tend to recommend dropping this exposure one stop -- after all, you may want your main subject to "pop" and the background to be a little darker. So switch to manual mode, and set an exposure that is about one stop underexposed.
2. Now pop up your on camera flash. Check the flash mode: "fill flash" will give you the best balance between subject and background. There's also a "flash compensation" setting, so if you are finding your flash is overexposing the subject, set the flash compensation to -1 or -2. Take the shot, and look how the subject and background are balancing.
3. For a more sophisticated take, consider "dragging the shutter" -- using a shutter speed that's a bit slower (for example, try 1/15th of a second). The flash will freeze the main subject, and the slow shutter may create a more interesting background to the shot. You can even purposefully move the camera to create a little bit more interest in the background -- you might get streaking lights or an overall warmly lit look.
In general, good compact cameras and good DSLR cameras do a reasonable job of balancing subject and background when handled this way, but usually you'll want to dial that flash compensation down a stop.