"With him" is possible, but the meaning is different from "to him".
E.g.
you see a guy with bruises all over his face. You ask, "What happened to him?"
It suggests something bad: he was in a fight, a car crash, some sort of accident.
or
"What's happened to Obama?"
This suggests that things aren't going as well for President Obama as they used to.
A girl might say to a friend, "You used to love him so much, and now you don't even want to see him. What happened with him?"
The idea is, what happened when he was present? What was going on between the two of you? That is, there was something going on that effected both of them and their relationship. What was that?
"Happen with" is also often used with objects. A boss might say to one of his staff:
"What's happening with that report I assigned you?"
That is, what are you doing with this report? Are you making any progress on it?
The second one you suggested sounds better though in this context.
Check out this