That guy definitely sounds freaky. So he's there when you go into class and when you go out?!
You should ask some of your closer friends if they can wait for you while you go to class? It might be a hassle for them, but it's your safety at sake. Or maybe have them pick you up? >.< and yeah, the professor will be a good person to turn to. If not, then maybe just walk beside another person that is leaving the class also, the guy seems to be afraid of other people at the very least. I really hope you get this resolved safely... o.o