I like a book (ebook) for this called a Magical Medieval Society: Western Europe by Expeditious Retreat Press, that I don't remember where I purchased. Probably drivethru or some such. It also is geared toward quick generation for D&D etc games, but it has great tables for "did I forget a profession" and a nice district system (it calls them wards).