The problem is probably due to your firewall settings, some security softwares block multiplayer games, to solve this, all firewall services have an option allowing certain things to get through, it should show a list of programs, check the box that says 'Hearts of Iron 2'. Ask your friend to do this for if yours is ticked, don't think it is not the problem for your friend may have it blocked but if for you and your friend it is ticked and doesn't work i'm afraid I don't know
I hope the firewall is the problem, Best of luck!