I always used an (adapted) form of the math from the 2e sourcebook High Level Campaigns.
According to that book, it was ~10% of the population has character classes, and ~90% are 0th level. For 3e, that would mean that ~10% has PC class levels and ~90% have NPC class levels. If 1 out of 10 is 1st level, half that are each higher level, with 1 out of 20 being 2nd level, 1 out of 40 being 3rd level, 1 out of 80 being 4th level, and so on (meaning 20th level PC-class characters are rarer than 1 in a million in society)
As to how many actually engage in adventuring. . .wandering from place to place, raiding dungeons, attacking BBEG's, generally being the typical D&D adventuring group? Probably very few. They aren't unheard of, but I'd say its 1% of society or less, maybe 1/10th of the population that has PC classes.
Most Clerics aren't adventuring clerics, they staff the temples and shrines. Most Wizards don't tromp around dungeons, they stay in their libraries and towers. Most Fighters are parts of armies or militias or city guards, not adventuring parties. Most rogues are independent thieves or part of a criminal organization, not an adventuring party. Monks usually stay in their monasteries. Druids patrol their woods and keep to their groves. Even Paladins probably work directly for a Church instead of being "freelance".
So, for the OP's question about Waterdeep, with it's population of about 2 million, I'd go with saying that there are around a quarter million there with PC classes (200,000 1st level, 100,000 2nd level, 50,000 3rd level, 25,000 4th level, 12,500 5th level), but only about 1/10th of those are any kind of regularly adventuring group, which would still make around 25,000 adventurers, mostly low-level ones. These are the folks that merchants might hire to find a lost shipment, or the city guard might subcontract something to, or that some wizards might hire for a "fetch quest" for some exotic spell components", or a temple might hire to help escort pilgrims.
In a fairly typical small village of 1,000 or 2,000 people you might have a hundred or two hundred with PC class levels, and maybe a dozen or two adventurers at most, meaning maybe 3 or 4 parties.