The following applies to the US Army as of 20+ years ago, but I doubt it has changed a whole lot since:
As far as I'm aware there are 3 main paths to becoming an officer: 1) West Point 2) ROTC and 3) OCS.
-
West Pointers are by far the most numerous, and they typically come from wealthier communities, especially in the NE. West Point is considered to be a top notch school, and the majority of people who go there to be upper crust types who later spend the minimum amount of time they need to be in, and then get out and go work on Wall Street or whatever. Some stay in and make it a career, of course, and these represent most of those above the rank of Captain.
-
ROTC - These are people who come from college ROTC programs and are more rare. I think they probably come from a range of different backgrounds.
-
OCS - Officer Candidate School - These are basically NCOs who became officers through the OCS program. These are also rare I think, but officers who go this route generally get more respect from enlisted ranks for obvious reasons.