I really like fernando's letter, which would appear to be well practised.
However, if you're being serious for just a tiny moment, you should keep it short, factual & boring - "As discussed on xx/xx, I resign from BlahBlah Ltd with effect from xx/xx. Please forward my P45 to the above address". Copy the letter before sending.
In my experience, as Mr fun says, you never know who knows who in your industry, and it could come back to bite you and you wouldn't even know about it. There are a lot of cnuts out there as well as the nice guys.
So, if you're unhappy with them, choose your moment & don't get spotted - you'll be happier for it & they won't know where it comes from. Discretion is the better part of revenge.