If you hit the lock/sleep button at the top, the call will keep going even though the phone is locked. You'll have to hit that button again and unlock your phone if you want to hang up or do anything else.
You should probably take the phone in to an Apple store to get looked at, since the proximity sensor is supposed to prevent the problems you're having. Apple claims they fixed any proximity sensor problems with iOS 4.1, so if you're at that version and still having issues, they need to know about it.