When you're having a conversation, things are often considered to be happening "at the same time". Yes, technically you heard it in the past, but we're talking about a few seconds in the past. Practically, you just heard it and are still absorbing the information (to hear = I hear your words, I am processing them, I'm still in a state of being surprised and sorry to hear this news.)
So the correct way to say this is definitely only "I'm very sorry to hear that." Hear doesn't literally mean hear; you could respond this way to a chat message, an email, even a letter (where the words are read, not heard). When you're sorry to hear something it means I now possess the knowledge that [x] happened, and as I speak/write this, I am still unpleasantly surprised by the events.
Even when you're putting this into the past, you still use hear and not heard:
Jane: Did you hear about Anne?
Mark: Oh, yes. I was very sorry to hear she won't be returning next year.
Am is shifted back to was to demonstrate the past tense, but hear remains the same. You wouldn't say "I was very sorry to have heard."