Vertigo,
The camera will moderate the flash to prevent overexposure. If your ambient exposure is quite dim the camera will add a lot of flash power to bring the levels up If the ambient exposure is quite bright the camera will only add a little flash, just to top up the exposure.
However, there are two main ways of using flash that affect your approach - direct flash vs bounced flash. If you use the builtin flash, or a Speedlite aimed straight at your subject then the subject will get blasted. It won't be overexposed, because the camera will control the flash output, but due to the inverse square law of flash falloff the background will not get much illumination from the flash at all. Therefore the camera, left to its own devices (Autoexposure), will try to expose the ambient scene almost correctly, which may well result in long exposures, and the flash will just brighten your subject to improve "pop" and to put catchlights in the eyes.
Note, if you use Av mode then the camera will drop the shutter speed as low as necessary in order to get a (roughly) correct ambient exposure, and this can catch a lot of people out. I found out the hard way when I shot my first ever wedding (a freebie for a friend, while I was also a guest) and used a Speedlite for the first time. I couldn't believe I was seeing such long exposure with flash enabled. It was a real head scratcher. This thread started my journey to salvation -
http://photography-on-the.net/forum/showthread.php?t=286091. Now I know better. You can adjust a custom setting to force the shutter speed to 1/250 in Av mode on the 40D. IIRC you get more options from the 50D and later. Personally, rather than be limited to whatever options the camera gives me in Av mode I just shoot manual and have things the way I like them.
The alternative approach is to use a Speedlite and to bounce the flash light off the ceiling and/or walls. When you do this the flash is going to light up the whole room as well as your subject. In this scenario you do not need a long exposure to bring up the ambient levels. The flash will light everything. If you were to shoot in Av mode the camera would still try to make the flash a fill light instead of a main light, so the shutter speeds may well be very slow and you could end up with blur/shake even though you were using flash. What you need to do is to take more control over the ambient levels, dialing them down a bit to get more agreeable shutter speeds. Then the flash will do the rest.
For example, I've shot a few weddings and flash use is commonplace indoors. Direct flash looks pretty awful, so bounced/diffused flash is the way to go. I will usually set a manual ambient exposure of something like 1/60-1/100, f/2.8, 1600 ISO. That is not enough to get a good exposure so the flash has to finish the job. However, at least I will have some ambient light coming in so I at least pick up some of the mood of the scene and the background does not drop off to pitch darkness.
Here's a typical example shot with my 30D at 1/60, f/2.8, 1600 ISO. It isn't perfect but hopefully you can see that I have a reasonable balance in subject lighting with the background.
The thing is, once I have my manual exposure set up for the ambient I can leave my setting like that all night long. My ambient exposure won't get thrown off by disco lights, wall lights, a sea of dark suits, the frame nearly filled by a wedding dress etc.. Within such a scene the ambient lighting does not vary too much. Sure there a re hotspots, but I want the camera to ignore them. Then all that remains is for the flash to earn its keep with ETTL exposure. But like I said, the flash can be fooled by a predominance of dark tones or light tones. The flash is aiming for neutral "grey" so you will need to wiggle the FEC a little from time to time.
Here's another example, this time in daylight so my ambient exposure was very different, but I needed flash because my subject really was poorly lit. EXIF is 1/250, f/2.8, 800 ISO. Flash was bounced/diffused.
Last one, this time with some punishing differences in light levels due to the lights directly in the picture behind the bride. EXIF is 1/60, f/3.5, 3200 ISO + bounced/diffused flash....
Do read Neil's tutorial. I am a beginner in flash and he is a God. Go and see what he says.