I've been a dev for about 8 years now.
I did some cool work (low-level, RE, R&D, etc) for a government contractor, but eventually burned out and had to leave. Started freelancing and have been moderately successful at it, but I'm not very excited by web development, particularly the pop engineering mindset that seems to pervade it. (The web always feels like a second-best delivery mechanism, too.)
I want to work on technical problems in an R&D setting, eventually building a product and delivering it. The research aspect is vital! A few examples: improving tooling for developers, such as compilers, runtimes, languages, and such. How do I move towards these positions?
My ideal position would be in MS/Google Research, but they want PhDs.
Also places such as yahoo research look for programmers to help out the researchers so check that out.