As many others have said, written documentation is very important for this issue. I think anything less is considered "hearsay" so a co-worker as a witness is probably not good enough. Get as much detail as possible and keep a running log. Save all (print it if you can) correspondence between you and your boss regardless of its contents. Same goes for phone conversations and voice mail if you're technically able to do that. I think you can find digital or tape recorders that plug directly into regular phones. Obviously, be careful with these devices since your boss or HR will not like you recording conversations. You can also send an e-mail to him after any meetings where you summarize what you talked about. Getting a reply is not so important as you having traceable evidence that you brought this matter to his attention. In other words you tried to resolve the issue professionally, but he did not respond.
Be careful what you say in person, the phone, or e-mail i.e. anything remotely negative or condescending because it can be used against you. Needless to say, don't expect a reference from your boss. You may want to ask your fellow co-workers or former bosses to be references. In this day and age, it's so simple to keep in touch.
Be squeaky clean while you're dealing with this issue since the company will try to find the slightest dirt to terminate you with cause. No more long lunches, smoke breaks, coffee breaks, etc. Also, start cleaning out your desk because your days are numbered. Kind of sad things have to end this way, but this is standard operating procedure for many companies these days. Get your files in order, speak with a lawyer, take legal action if necessary and get out of there. Winning a case against your boss will be a good thing, but don't stick around (no matter how much money you make, how much you like your job, etc.) because your life will be miserable.
I personally wouldn't even accept a transfer to a different department since the company seems to tolerate this kind of behaviour from its managers.