I'm lucky that all the key jobs at GrantTree (Client Management, Sales) are naturally not predominantly male or female.
Obviously that's not the case for every company. Ultimately, if 90% of developers in the country you're in are male, it's going to be pretty damn hard to keep any kind of balance in your development team. I think you just have to accept that, and continue to hire based on excellence rather than trying to bias towards gender (which is illegal anyway).
However, there are completely legal things you can do to try and tilt the balance in other functions, so that at least the company as a whole is balanced. For example, advertising on sites that aren't themselves predominantly male, and wording your job ads so that they make it clear that women are most welcome, helps to tilt the balance of applicants, which allows you to maintain the company balance while still hiring the best applicants.
I don't think you can solve macro-societal issues like gender balance among software developers in general just by tweaking your hiring process (though I'll be happy to be proven wrong), but that's not an issue of sexism, just an issue of reality.
I haven't yet considered how you'd solve that problem at huge scales, like if you were Microsoft - probably others might have more useful opinions on this. My points above are more relevant to smaller companies. I'm sure there's a number of people at Microsoft worrying full-time about this.