Since no one else has answered I will try.
moddir is already part of HOI - there is no need to install anything.
The 1.04 readme (which introduced moddir to HOI) says
"HoI can now be started with a "moddir" as an argument. This will make the game look for files in that directory structure before looking at the normal place."
This allows mods to change the content of files (such as infantry.txt) without destroying the basic HOI files. In this way both the mod and basic HOi can exist in the same installation without one destroying the other.
For example the CORE mod uses moddir. Their startup icon has the following command line:
Files\Strategy First\Hearts of Iron\HoI.exe" mod-CORE
What CORE has done is set up a directory called "mod-CORE" underneath the HOI main directory. The command line then uses the files in the mod-CORE directory.
moddir does not work perfectly. There are some "issues" that the modder needs to work around. I think you can find a discussion of that in the CORE thread.
My suggestion is to install a mod (such as CORE) that uses moddir and look at what was done as far as the directory-file structure is concerned.