Initial users were personally invited by the initial team (Jeff etc). The two founders, Jeff Atwood and Joel Spolsky, both had software development blogs with a huge following, Coding Horror and Joel on Software, respectively. By inviting users to join via those, they created a pretty decent seed group.
They created the initial set of questions and answers which drew people to the site. After that, people joined the site and contributed themselves (though we have a lot of drifters who come only for a post or two).
Nowadays, we have Area51 to help create new sites. Sites only go into beta if a minimum number of users show interest in them, and once in Beta these same users are expected to fulfill their "commitment" to the site by giving it the initial momentum.