I imagine that to learn classical music, a person would have to be in a family wealthy enough to afford lessons and custom made equipment. Yet, I don't imagine being a violinist in an orchestra as being a well paying profession. Where did these people come from?
Musicians were considered as servants, your average musician was not making bank. They were employed by a rich family or the Church, and some times performed non-musical duties for their employer. It was not rare to see musicians having a steady position, but also trying to find gigs wherever they could, and having students. They some times would send their students as replacements for rehearsals at their steady orchestral job while they were working at gigs...
Being a musician was not a proper thing for a wealthy person. Yes, many rich people studied music and even some times performed in public events, but for them it was a hobby. Some very rich and powerful people were highly trained and some times talented, and we have music composed by kings and what not, but even if they dedicated a lot of time and effort to music, it was just another activity they liked and not their "profession."
It is common to see musicians being born in families of musicians, they were trained by their relatives. People from families of non-musicians would some times hire musicians to train their children (this happened with the super rich and in people below that class. Private instructors would work one on one with students, or in small groups). As you can imagine, this was not doable for the extremely poor or people living in the middle of nowhere, not having the money, time, access to teachers, or even equipment to pursue serious training in music. There were alternatives, like the Church, and some orphanages (run by the Church but also getting money from rich people). Those institutions would provide musical training and lodging.
For a long time, the training of musicians was a form of apprenticeship. Music schools closer to what we know start to appear in the 18th century, and the model for modern conservatories starts in the 19th century.
Just to emphasize /u/erus's point, the famous Baroque composer Vivaldi was composing his concertos for children at the Ospedale della Pietà (an orphanage, primarily for girls). One of the purposes of learning an instrument was that it made women more desirable for suitors.