Alright, so after looking at the map and counting the number of "houses", I came up with about 70 tombs in the main part of Hammerfast that can house people. The book says that usually several families call a tomb home, so let's assume 15 dwarves per tomb. That gives us 1050 people. Throw in some people to represent the clergy of Moradin and Gruumsh, and you'll have roughly 1100 people.
In the gate ward, we have the barracks for the city guard, as well as the Swiftriver clan and some other civilians. If we assume the guard is roughly equivalent to 10% of the dwarven population that gives us 110 people, and I wouldn't be surprised if there were no fewer than 30 swiftriver halflings. The book mentions about 10 other civillians in the gate ward, so we can reasonably triple that to 30. This equals 180 permanent residents of the gate ward.
Our total is 1,230
The wild card in this equation involves the ghosts. Do the ghosts count as population? If so, there could be millions of people in Hammerfast, but I'm inclined to believe that the only ghosts here are those with undisturbed tombs, so I'll just say those cover my initially generous inhabited tomb estimate.
I'm going to say that the population of Hammerfast is approximately 1,200 people. Very little information is given about the population of the surrounding area, all we know is there are bandits, goliaths, a mining operation, some orcs, some goblins, some trolls, and a garrison at the intersection of Two Roads. Here's some rough, wildly innacurate estimations for those.
Bandits: There are "A Number" of marauding gags live in the area. Both the gangs detailed in the book have seven members, so we'll use that as an estimation. Let's say "a number" means "10". That gives us 70 bandits.
Goliaths: There are "Several bands" of goliaths in the mountains. Let's say there are four bands, each with 10 people. That gives us 40 goliaths.
EditI've been informed that a band is a larger group of people, between 30 and 50. We'll average them at 40 and say there's about 160 goliaths.
Miners: According to the entry for Highpeak, there is a heavily guarded small fortress with "a number" of mines active. Assuming 50 guards, which would be heavy for a fortress that size, and 10 miners each in 5 shafts, we have 100 dwarves.
Orcs: There is a full tribe of orcs living in the mountains. This tribe isn't big enough to be mentioned in the DMG, or anywhere else in the book. Let's assume 50 orcs and be done with it.
Goblins: The book states that these goblin clans occupy small outposts throughout the mountains. Multiple clans, and there are always more goblins than orcs, so I invoke the rule of three. 150 goblins.
Trolls: Between the hag Stravalla and her troll and werewolf minions, and the fact that this is an area devoted to heroic tier play, I'm going to assume there are only 30. Any more would be too great a threat for the PC's.
Garrison: The small garrison relies on ballistas and crossbows, and is small compared to Hammerfast. I'm going to estimate 25 dwarves.
Assuming a scattered population of 35 hermits, solo monsters, and other inhabitants, this gives us 620 people living in the area around the mountain.
So that is my final population estimate.
1,200 living in the city
620 living in the area around the city