I've lived in the New Hampshire and Massachusetts all my life, and I don't think you could pick a better place to visit. Some of my thoughts on your various destinations:
Boston: Park the car someplace accessible on the outskirts and spend the day walking the city. Driving in Boston is enough to drive even the experienced person insane at times. The Public Gardens/Boston Common, Copley Square/Back Bay and Post Office Square (interesting architecture) are all nice. Faneuil Hall and the new greenspaces over the Central Artery Tunnel (Rose Kennedy Greenway) are great places to walk as well. Old Ironsides isn't far away.
Bangor: I'm less familiar with Bangor, but Bar Harbor/Arcadia is a beautiful place. Plenty of Bed and Breakfast type places to stay there. There's plenty of places along the coast that a beautiful. Stay off the Interstates if you can and go up the coast highways like Route 1. Lots of beautiful old mansions and seacost vistas in NH north of Hampton on Route 1.
White Mountains: I used to vacation here almost every year as a kid. You can't go wrong in any of the major Notches (Franconia, Pinkham, Crawford) through the mountains for scenery. Lots of mini-hikes available to various scenic places (falls, natural attractions, etc.). Another very nice drive is the Kancamagus Highway from Woodstock to Conway.
Cape Cod: I've vacationed there a couple times. Beaches are great, though they can get busy. We've typically gone at off-peak time (just before Memorial Day or just after Labor Day) when they are much more reasonable. Driving just about anywhere along the coastal roads can lead you to a scenic vista at any time.
Historical interest: Most of those areas are going to be in and around Boston (Bunker Hill, Old Ironsides, Freedom Trail, etc.). Without heading further west towards the Hudson River (Bennington, VT/Saratoga/Fort Ticonderoga/etc.), the historical attactractions are spread out and hard to hit without a specific interest. OF a Naval theme, my family recently went to the USS Albacore Museum in Portsmouth, NH. The Albacore was an experimental sub that was used to develop a lot of the features of modern day subs, like the teardrop hull shape. It's a small place, but interesting if you like subs. Fairly easy to get to from Route 95.
When you shoot at a destroyer and miss, it's like hit'in a wildcat in the ass with a banjo.
Nathan Dogan, USS Gurnard