Their purpose seems to be storing settings that haven't even been changed from defaults. This being Microsoft, for some reason they think "it good idea!!" to cache every damn thing whether needed or not.
I'm guessing there's so many because of the quantities of EXE versions. (Since I have multiples for other games I update but not for ones that stay constant.) Looks like it auto-generates these keys whenever you run something that uses any class of DirectX.
I deleted and remade that DirectInput key (after exporting of course) with no ill effects. Since it can't clean up on its own, I removed everything but the MostRecentApplication subkey and set permission " Everyone: Deny: Create Subkey" on the DirectInput key. Certainly isn't keeping my controller from working, but it does prevent all these useless keys.
Registry key permissions are a powerful tool. (But not a toy.)