Michelbach and Moosbronn are outlying parts of Gaggenau that cannot be reached by S-Bahn. The easiest way to get there is the bus 253 which departs in the square opposite the station (Gaggenau Bahnhof). Buses run hourly until very late in the evening, they depart in Gaggenau on the full hour. The ride to Michelbach takes 6 minutes, to Moosbronn via Freiolsheim 20 minutes. The road to Moosbronn leads over the mountain ridge and is rather scenic, even with some views over to the Rhine plain. If you don't want to hike all the way to Moosbronn, or hike only one way, the bus is a convenient alternative.
KVV tariff applies. If you arrived by S-Bahn, your ticket is also valid on the bus.
The Murg Valley S-Bahn is the KVV's longest tram line into the countryside. It runs all the way to Freudenstadt, two hours from Karlsruhe centre, some even further to Eutingen im Gäu. Forbach is about in the middle of this route. A really scenic ride with a lot of Black Forest landscape to enjoy, by the way. The trams stop at every village. There is a regular tram that stops everywhere once per hour, in the morning and afternoon every 30 minutes. Express trains (Eilzug) run every two hours; these are notably faster because they only stop at the main stops.
Within the boundaries of Gaggenau, the S-Bahn has seven stops; I am listing in italics where to get off to reach which attraction:
1. Bad Rotenfels Schloss -> Rotenfels palace, Unimog museum
2. Bad Rotenfels Bahnhof/Rotherma -> thermal spa, Kurpark, village centre
3. Bad Rotenfels Weinbrennerstraße
4. Gaggenau Bahnhof -> town centre of Gaggenau, bus connections e.g. to Michelbach
5. Gaggenau Mercedes-Benz-Werk
7. Hörden -> rafting museum Haus Kast