"Five years ago, Bill Gates issued a memo to all Microsoft employees explaining the importance of building more secure software. Since then, many people across Microsoft have worked to improve the security of their products. In doing so, we've learned a lot about what it takes to build more secure software."
In the November issue of MSDN Magazine, Michael Howard, a Principal Security Program Manager at Microsoft and author of several books on software security, outlines 10 lessons we've learned about what it takes to build more secure software at Microsoft.
Hopefully there are some tidbits here you can take to your own coding.