A flash meter can really help you here, as you can take both an incident reading to get the available light exposure down, and then take a flash reading to set your subject exposure. It's not trial and error, but rather a matter of physics.
That said, the way to approach this is as follows: establish your available light exposure first. I would take an incident meter reading of your background scene and then set the camera to underexpose by 1-3 stops so that you achieve the background look you want. This is easy with digital, since you can see what you've just shot on the LCD. Choose a combination of shutter speed and aperture that allows for a shutter speed below your maximum sync speed. That is, if your camera's maximum flash sync speed is 1/250th. of a second, choose a combination that lets you use that (or a slower) shutter speed. For the sake of this discussion, lets assume you settle on 1/250th. of a second at f/22, and that these values represent 2 stops of underexposure (that is, for "proper" exposure you should use 1/250th. at f/11).
Once you've established the look for your background, you need to decide how you want your subject to appear. You're going to use your flash for this, so the only thing that matters is the lens aperture. This is really simple to do if you have a flash meter and the ability to set the power level of your flash. Assuming you want your subject exposed "normally", you take flash meter readings from the subject position and adjust the output of your flash until the meter reads f/22. Now, when you make your shots, your environment will be underexposed by two stops and your subject will receive an amount of light necessary to achieve normal exposure.
If you don't have a meter, you can still easily set the flash if you know it's guide number. (This is where the physics part enters our discussion.) The guide number represents the amount of light emitted at full power. To figure your exposure, divide the guide number by the distance from the camera to your subject. The result is the f-stop you need to use. (Example: guide number of 160, 10 feet from camera to subject. 160/10 = 16 or f/16). You can multiply the guide number by the power setting to change the needed f-stop. (1/2 power * 160 = 80. 80/10 = 8 or f/8).
Ok, so you're set at 1/250th. at f/22. But your flash has a guide number of 160 and you are 15 feet from your subject. To properly light your subject the aperture needs to be 160/15 which is 10.667 or ~f/11. Now what? You need to open up the aperture by two stops and raise the shutter speed by an equal amount to keep the background the way you want it. But your camera won't sync with the flash at 1/1000th. of a second. You might be able to lower your ISO by two stops, but if you were shooting at ISO 100 to start with you probably don't have that much room.
A real good solution to this problem is to use a neutral density filter. A two stop ND filter would allow you to open up your aperture two stops while keeping the shutter speed at 1/250th. ND filters give you more control over your apertures in this situation too. You may want to shoot at f/5.6 in order to control depth of field. Given the above situation, a four-stop ND filter would let you do that.
People who do stupid things with dangerous substances often die! -me