I wrote:

..this code uses Managed DirectX9. It can be hacked and extracted from release version of standart DirectX 9.0c redistribution packages, mdxredist.msi, if you have right tools, and if you didn't done it already, install it as

msiexec.exe /i mdxredist.msi

That's all!

There is another way, if your qualification is not allows to extract this file, simply run

setup.exe /installmanageddx

P.S. in common case, mdxredist.msi is located in mdxredist.cab shipped with realease version of DirectX