Depends on what type of VFD you have, there are VFD's which do not require any dust protection because they are already protected from the factory but they all come at a price premium. These are IP54 and over, the most common type of VFD is IP20 rated and this will have no protection against dust and anything coming out of your grinder.
I have 50x2000mm belt grinder powered by an IP20 Invertek Optidrive E2 VFD, it's fairly expensive so I made a totally sealed enclosure for it. The enclosure is a pelicase in which I fit the VFD and it's controls. I took off the original case of the VFD then ducted the heatsink and sealed it from the out side so that there is no exchange of air to the case. The cooling air just flows through the heatsink.
Some might think the enclosure is too small and it will over heat, but in reality the enclosure plays no part in the cooling capacity of the VFD, the heatsink does. I operate the grinder in +35degC ambient temperatures.
Some photos of the setup which could be adopted to other types of VFDs.
The Invertek Optidrive E2 VFD as originally purchased
Pelicase enclosure – I transferred the original display to the enclosure and installed the controls.
The heatsink is ducted and totally enclosed, so the air flowing through does not enter the case, it just cross flows through the heatsink from one end to the other.
The VFD minus it's original cover.
The plug connections power in for the VFD and power out to the motor.