Depends on where and when in the middle ages you were living.
But for arguments sake, say you're in the mid eleventh century. Say you're moderately well-off, perhaps the second son of a landholder somewhere in southern France. As the heir to the title, your eldest brother's already pretty much entrenched himself at father dearest's side, while your obnoxious younger brother is undertaking ecclesiastical studies in the cathedral-school of Notre Dame de Paris. You've never been much of a fighter, so asking the Count of Provence for a knight's fee isn't really a viable option; you could go to Bologna and get a degree in law, especially useful as Count Geoffrey is looking for legal loopholes to extract his county from the Holy Roman Empire, however you were never much good at abstract-type thought needed in law school. What's left for you do? Well, you can always study medicine and set up a practice in Marseilles!
Now, early universities weren't at all like universities as you know them: students paid fees to the professor, not a registrars office. At the end of studies, varying authorities (in Paris, for example, the Chancellor of Notre Dame) proclaimed students graduates. In later centuries, higher authorities would provide for facilities, lodging, and rules regulating education and how degrees are to be awarded (King Philip Augustus of France, for example, did so for the University of Paris in 1200). But in the eleventh century, you wouldn't be setting out to study at a University, rather you would set out to live in a city renowned for its scholars.
For argument's sake, let's say you decide to attend the most prestigious medical school of the Mediterranean: Salerno. Indeed, father tells you that the Archbishop of Laon passed through your lands some fifty years ago when traveling to Salerno to be cured of an ailment.
Salerno had been the largest and most important city in (christian) Southern Italy since the peninsula was cut in half by the Carolingian conquest. With Naples a Byzantine Thema (military outpost) most southern Italian trade passed through Salerno, which quickly became the most important city of the post-Carolingian Lombard rump state. Along with goods came people, and what with the Byzantine military presence in Puglia, Calabria and Naples, the Southern Italian Princes seemed to be much happier to welcome people from the Arab world as opposed to Greeks. Indeed the first "classes" in medicine were held in the eighth century by the luminaries of the day in the Prince's Palace, later moving to minor chapels in the Cathedral only as the school expanded.
After disembarking in Salerno you need to enter a contract with a professor; you might even be able to study under Constantine the African, who at the time would be translating into Latin not only the medical treaties of the Persian Polymath Avicenna, but more importantly the works of Hippocrates and Galen (of which only the Arab translations survived) as well as the works of Ali ibn Abbas, al-Jazzar, Rhazes and Isaac Iudaeus.
True to the fact that the concept of "University" wouldn't emerge for at least another century, Salerno was simply recognized as a medical "School," from the Greek word Skhole, meaning a place of learning. Individual study plans might vary, but typically consisted of three years of "Logic," which normally covered ancient Greek and Roman (principally Aristotelean) philosophy (useful to bring a student's Greek and Latin up to scratch) followed by five years of medical studies coupled with surgery (a fully qualified medieval doctor would seldom perform a surgery himself after prescribing it, often a butcher, barber, or medical student would perform it instead). Lastly, a prospective doctor would serve as an apprentice with a senior doctor for a year before applying for a certification from the "Colegio," or association of doctors in Salerno.
A doctor's certification would qualify a man or woman to practice and teach medicine wherever the School of Salerno was recognized. And yes, I said or woman, as women as well as men attended the Medical School in Salerno. Indeed, the first gynecologist we know of of was a Salernitan woman called Trotula de Ruggiero. Specializations were also common, and not limited to gynecology: Garioponto, sometimes rendered as Guarimpot, was a renowned urinary and renal specialist in the eleventh century.
Now, although I don't know the specific cost of attendance, I can tell you that not everyone could become a doctor. Even if you didn't undertake an expensive journey to Salerno and studied in Paris, Bologna, or with a qualified doctor in Marseilles (you're from Southern France, remember?) you would have to have enough disposable income to maintain yourself through your studies, limiting attendance to people whose parents had extensive estates. Costs like lodging were somewhat reduced for members of the clergy, and indeed many scholars in Salerno were clergymen, however unlike scholars of Law and Philosophy who could aspire to high administrative positions, it is more difficult to balance a medical and ecclesiastical career.