Reason has a great behind the scenes article on how Heller happened. Well worth the read.
In retrospect, D.C. v. Heller seems almost inevitable, because of shifting public and academic attitudes toward gun rights. But victory came only after a protracted struggle, with many pitfalls along the way. It was pulled off by a small gang of philosophically dedicated lawyers—not “gun nuts” in any stereotypical sense, but thoughtful libertarians who believe Second Amendment liberties are a vital part of our free republic. Together they consciously crafted a solid, clean civil rights case to overturn the most onerous and restrictive set of gun regulations in the country. In the process, they set the stage for further legal challenges to other firearms restrictions from coast to coast.