I was talking to Prakash Swaminathan the other day and he said something that I thought encapsulated the essence of having a great professional life.
(a) Work with people you admire, (b) on interesting projects and (c) work from home as much as possible.
I could imagine dropping (c) if the other two criteria were met (though it does make a lot of sense in today's networked world) but whenever I've compromised on (a) or (b) life has sucked, without exception.
So children,learn from your elders. Always work with great people on great projects and avoid the corporate politics bullshit and you'll be happy professionally.
Of course this assumes you are skilled enough (or are willing to work to get there) that awesome people want you on awesome projects but that is a different post altogether.