At his blog, In Deep Places, Evan has been wondering about the demographics of city states. My reply is bit too long for a comment, so I'm resorting to another blog post.
I'm going to be pretty flexible in my definition of city states here. Traditionally, the city state is a city that is also an entire nation. Today, both Singapore and Vatican City are considered modern versions of the city state. However, many of what we call city states from the past violated that definition little bit. Classical Athens, for instance, made itself the capital of an expanding empire, the acquisition of which led to the Peloponnesian Wars. In this case, I'm going to call a city state any nation dominated by a central city whose borders extend only to the extent of a few days march.
Heck, even that is problematic, because what exactly is a city? These days, any respectable city probably has a handful hundred thousand citizens. The walled city of Jericho at around 8000 BC probably boasted a population as large as 2000. Here's another fact about Jericho to twist your noodle: cities started forming before agriculture. It appears that the walls of Jericho may have been built to protect rich hunting and gathering territories. Settled living probably later led to the development of agriculture, rather than the other way around as we were taught when I was in elementary school.
So exactly what we're talking about when you say city states entirely depends on what you want in your game. I'm assuming that Evan’s thinkgin along the lines of the classical city state like we see in ancient Mesopotamia or Greece. Where you find city states like these is pretty simple; human communities form near water. It's vital for drinking, it's vital for agriculture, it's vital for sanitation, and helpful for both defense and trade. So, if you have a map of your world, your rivers are going to run from the mountains to the sea, and population centers are going to be placed along those rivers. You can also put small cities in desolate places where there are oases, and, if you don't mind being completely fantastical, you can have magically supplied cities.
The why of city states might not be nearly as important, especially if you don't really want to get into the mechanics of demographics. Many city states seem to be primarily about defense, like ancient Jericho. People gather together, build walls and other defenses, and protect their rich territory from those who would invade. Others are more about geography. Rough terrain, like you find in Scandinavian countries and in Greece, tend to support the creation of small, isolated communities. The terrain was fertile enough to support the creation of city states in Greece. In Scandinavia, communities tended to be much smaller and there seem to have been a much stronger emphasis on going elsewhere (going “a-viking”) whenever possible.
So, the question of supporting themselves is fairly simple. For the most part, these city states are going to be self-supporting. Local agriculture will be producing enough food to support both the farmers and non-farming citizens of the community. Keep in mind, most everyone was a farmer in ancient Greece. They may have had their home within the walls of the city, but they usually had a plot of land outside as well. The Spartans got away with not having everyone be a farmer by invading and enslaving the local population, the Helots. The indigenous slaves did all the farming, freeing up the Spartan men to concentrate almost exclusively on warfare.
With agricultural surpluses, the city state doesn't necessarily need to trade with anybody. Trade frequently happens where communities intersect, but it's not a given. In fact, the closer communities are to each other, more likely there is to be acrimony, especially if their territories are close enough they could possibly overlap on each other. In this case, it's not unusual at all for one city state to utterly dominate its neighbors, and now we’re back to empire building.
So for Evan’s underworld campaign, I’d suggest city states be placed fairly far from one another, with at least 50 miles between each. The intervening land might be peppered with small freehold farms and farming communities which help support the city state. I'd clustered these in river valleys, arable plains, or at oases. Local culture and character can be heavily influenced by local resources. A city state on the edge of the jungle, for instance. is going to sport a lot of wooden structures, while one in the hills or at the foot of a mountain chain may use more stone. You can break this pattern to create mystery, a sense of unease, or say something about the local cultures. Maybe the city state at the edge of the jungle uses stone because the forests of the jungle are too dangerous to harvest. Local customs, holidays, clothing, and diet will be heavily influenced by what is available in the area. Salted fish, fried locusts, and beer were favorite foods in ancient Ur, while in Athens you're more likely to find wine, bread and olive oil as the staples of the diet.
So yeah, I'd create a scattering of city states with maybe 75,000 total souls in each larger metropolitan area, in states of either uneasy truce or frequent war with one another, and each largely self-supporting. That should create all sorts of fun political tensions, reinforce local character, and provide frequent opportunities for adventure.