Essentially what you're doing while doing this is metering your flash and allowing that to control the exposure on your subject and then you are using your shutter speed to reduce the amount of ambient light. So...
Let's say that to get a perfect exposure of the background you're shooting F8 at 125. But you want to make the background darker. So you would increase your shutterspeed maybe 250 gives you the look you want. Fine. Your flash is set to F8 and you will get the image you want. You do need to experiment with it though.
This shot was shot that way using two flash units:
This one was done using the same technique but with an on-camera flash (SB-600):
