Actually, the blur is kind of neat in a way.
If your camera supports it, go to manual focus and focus on infinity. Probably your camera is trying to autofocus, and many cameras, if they hunt and can't find anything to focus on, will default to 2.5 meters or so, since that's the most common distance to take photos of people at, and it's also about as far as the flash can reach.
Also in manual focus mode it will take the pictures a lot faster after you push the button, since it's one less thing it has to do first.
If you can do it, using "bulb" shutter at f/16 or so and ISO 100 on a tripod, using a cable release if you have it, and holding the shutter open while the shells burst, gives pretty good results. If you don't have a bulb setting, use 2 to 5 second shutter times. Keep your fingers off the camera as much as possible. If you get shake from your camera, you can try using the self timer, especially if it can be set to something short like 1 or 2 seconds, so you can push the shutter, get your fingers off the camera, and give it time to stop shaking before it takes a photo.
But fireworks are one area where experimentation and even mistakes can result in really cool looking results.Here are my photos from last night if you want to look.