In 2008, I spent five nights (six days) in the Harz mountains. My journey began with a train ride from Hannover to the train station in Bad Harzburg, on the flat lands north of the park, followed by a half hour bus ride up to the mountain town of Braunlage. My first day was spent exploring Braunlage. The next day I went by bus back to Bad Harzburg, from which I took the train to Wernigerode, and visited the castle there.
The following day I went by bus to the town of Schierke, then by narrow gauge steam train to the top of the Brocken, the highest mountain in northern Germany. I finished the last day with a bus trip to Clausthal-Zellerfeld, also in the Harz.
I found it very easy to get around in the Harz by public transportation.
The last day I took a bus to Walkenried, on the south side of the park, from where I took a train to Northeim and on to Frankfurt via Göttingen. The train from Walkenried to Northeim goes through Bad Lauterberg, from which bus 471 takes 40 Minutes to Osterhagen.
So, I would recommend you staying in Braunlage, which has easy access to Wernigerode and Quedlinburg as well as being close to the Brocken, which I feel is a worthwhile place to visit. Then when you leave, take the bus south to Walkenried, the train to Bad Lauterbach, and the bus to Osterhagen.
In over 150 days in Germany in the last 25 years, I have found that, although using public transportation often takes longer that having a car, having a car costs 2 to 3 times as much, and then you have to worry about places to park. Also, whereas in the US to get anywhere you either have to drive your personal car or fly and rent a car, in Germany public transportation offers an efficient alternative to using a car. To me, availing myself of public transportation that actually works is one of the unique and fun experience, something I can't do here.