John, You just need a photo editor that has a layers capacity. If you have a castle shot taken from the very same vantage point and focal length, where the castle is nicely exposed, you can copy that photo, then add it to the fireworks shot as a new layer. You'll end up with one photo stacked over the other. By either masking the layer, erasing out the parts of the layer where you want to show through what's behind, or changing the layer's opacity mode to 'lighten', then using an erase brush to get rid of any unwanted brightened areas, it will allow you to have the fireworks exposure show through in most of the shot, but where the castle is you'll have the nicer castle exposure from the layered shot instead of the darker castle.
I don't have a fireworks example, but here's a quickie example with a moon shot. I have a shot of just the moon in a black sky...so I add it as a layer to a shot of the Mexico pavilion and change the blend mode to lighten - the dark sky is darker than the sky in the Mexico exposure so it doesn't show up, but where the moon is in the layer shot is brighter than the sky, therefore it shows through:
I can take that same moon shot, and stick it in this Epcot lamp shot using the same layer method with 'lighten' blend mode:
