@Robert
In the Combat Move section of the Europe rulebook there is a picture example similar to what you’re asking on page 14. Here’s the caption:
“Sea Movement Example: Sea units other than submarines must end their movement when they enter a hostile sea zone. The destroyer must stop in this zone. However, the submarine can pass through safely because the enemy unit isn’t a destroyer.”
Although in the example the sub isn’t attacking anything in the destination sea zone, it is still moving through a sea zone in which a combat is going to occur. (perhaps because it is moving to escape a combat due to starting in a hostile sea zone, in which case it would be moving during the combat move phase although not attacking anything)
Long story short: According to the example, yes, you can move subs through B to get to C, even though B will also be attacked, as long as no destroyer is present in B.
For future reference there’s actually a pinned thread for these kinds of questions. The rule deputies usually answer them pretty quickly.
https://www.axisandallies.org/forums/topic/18412/global-2nd-edition-q-a-aag40-2/2776