There are the settings I used to create this shot:
ISO 100
F16
BULB
Manual settings
Camera mounted on tripod
Cable release
What I did was use the cable release to open the shutter in "bulb" then close it once the firework had finished exploding.
Here is the photo