First of all, do you have the original Heroes or the spin-off versions? If it's the spin-off, you don't need any patches. :)
To play online, you need to download and install the Hamachi program (
download). Then, join an existing network (look in any of the online tournament threads for Heroes 4; you'll find the network name and password there), or create your own.
Agree with someone on a game. In Hamachi, each player has an IP address listed (next to their nickname). The main thing is that you and your opponent are in the same network. Then, agree on who will be the host (the person creating the game). If it's you, launch Heroes, click "Network Game," then "Create Game," then select "via TCP/IP." A window will appear where you can give the server a name (optional), enter your name/nickname, and specify the number of players. Then, click "Create" and select the desired map or save file. And wait for your opponent. When they join, choose races, colors, game difficulty, time, and whether a password is needed for the game. And you, as the host, start the game.
If your opponent is creating the game, in the launched Heroes, go to "Network Game," then "Join Game," then "TCP/IP." In the window that appears, enter your opponent's IP address, which you'll see in Hamachi next to their nickname, and click "Join." Then, choose a race and wait for them to start the game. :)
That's basically it. I hope I explained it clearly. If anything is unclear, don't hesitate to ask.