I had my first job at age 21. A month before my 36th birthday, I left my last job. I have not been able to get a job since.
I have applied for 58 jobs over the past year and have gotten a response 11 times. I got a phone screen for three of these jobs, and got to an in-person interview for one of them. All rejected.
I am not a superstar but I have built solid things including sites from scratch that are still running on the web. I worked on parts of an iPad app that has over 3 million downloads in the app store. I solved the programming challenges on the HR pages of two hot companies. (Didn't hear back from one, was told there weren't any positions for me at the other) I even was on a team that made it to a y-combinator interview. My other HN account has a decent amount of karma.
I just say all this to point out that I'm not the typical square sob story where some guy making crystal reports for 15 years get the boot from IBM and spends his days whining about H1Bs on patriot message boards. However, sometimes I wish I was one of those guys. I can't even get a job doing something like ".NET Sharepoint integrations" because I've never done it before!
I'm mostly zen about the whole situation but at times I catch myself sliding into serious depression. I've been working on iPhone UI programming to learn something new. However, in the back of my mind I know that even if I get a job, something like this will happen again when I'm 42.
I don't know how I would get a management job, but I'm not convinced management is a safe haven. I have two uncles who worked at IBM for decades. They were made redundant in their early 50s and never worked in the industry again. Then again, at least they made it another 15 years and were able to pay off their house.
I could write more but you probably get the point. My only advice is to make a lot of money when you are young so you can coast when you get old (35?). I basically think programming is like pro sports. You can be an amazing rookie in your early 20s, a kobe like superstar in your late 20s and even early 30s. But mid 30s you need to make way for the next generation.