Are submarine launches horizontal? is a general question and specifies by name two large ICBMs which are likely to need to be launched vertically.
Since the large naval submarines usually come ready-made with torpedo tubes, there are certainly rockets that launch from them that later break the surface and fly in the atmosphere, but the examples I've found are all weapons that target things on or near the surface of the Earth.
Question: Has a rocket launched from a torpedo tube ever reached space? It could be a test or one-time demonstration, it doesn't have to be a production design.
Examples of rockets launching horizontally from torpedo tubes:
Source: Harpoon click for larger