Yahoo has some thoughts on including asking for your comments to be anonymous (yeah, like that will happen), anticipating the important questions, and offering constructive solutions. It's an ok piece if you feel you MUST comment. But here are my thoughts on an exit interview:
1. An exit interview is for the benefit of the company only. In no way will you gain from it (in most cases). Remember, you've already moved on (theoretically) and have another job. So why do you care anyway?
2. Given #1, I would avoid an exit interview if at all possible. If asked to give one, I'd say "I don't really have anything of benefit to contribute in an exit interview" or something like that.
3. If forced to do an exit interview, offer a few minor suggestions for improvement (ones that "everyone" knows need to be done anyway). This way, you've offered them something that an HR person can put in a file and feel like they've accomplished their job for the day.
4. Whatever you do, do NOT badmouth you boss, co-workers, executives, the company, etc. You will get zero benefit from this (other than maybe feeling better for 15 minutes for venting), but it could come back to bite you. It's a small world out there and a bad comment directed to the wrong person could derail some of your future plans. Don't think it will happen to you? I'm telling you, I've seen it happen time and again. Be nice and don't burn your bridges.
What about your "friends" still at the company? What about giving an honest assessment of the situation and "telling it the way it is" to help them out? I'm ok with this as long as those same friends will help you pay your bills when your career is negatively impacted, when you can't get a job/promotion you want, and so on. In other words, forget about "helping" out your friends. It's harsh to say, but they'll need to fight their own battles. For the sake of your career and your earning ability, simply move on, thanking everyone for the opportunities they gave you while you were employed.
All this said, I think this discussion is a moot point for many of us. The last time I had an exit interview was about 15 years ago. Do many companies even use them these days?