So, My understanding is that fighters and bombers can attack submarine by themselves and submarine can not fire back.
Please confirm that.
Correct.
So how does submerging work here?
Subs may submerge at the end of any round of combat if there are no opposing destroyers in the battle at that point (as long as the battle is not over). They have no effect on other units while submerged, and are ignored. They resurface at the end of the noncombat movement phase, having no effect on enemy units in the sea zone at that point.