MAME uses Raw Input, and Raw Input has significantly less input lag than Direct Input or XInput. Direct Input processes input data before the application gets it, and that's why it's so much more laggy than the other APIs. It blows.
MAME uses RawInput for keyboard and mice input. It uses DirectInput for joystick. There are currently no other options for MAME at this time.
No USB gamepad can take advantage of Raw Input natively--only mice and keyboards can. Finally, you can use a PS/2 keyboard encoder with Raw Input in MAME. It's about as responsive as you can get.
You can use RawInput to read joystick data as with any other HID device. Call RegisterRawInputDevices with HID_USAGE_GENERIC_JOYSTICK and HID_USAGE_GENERIC_GAMEPAD then read the data in WM_INPUT. RawInput is a layer above the HID user library. You can in fact use it to read the raw joystick data and bypass RawInput altogether if you wanted to.
Clearly using RawInput is the recommended way for reading mice and keyboard and allows MAME to support multiple devices as well as higher DPI mice. I just don't believe there is any significant benefit to using RawInput when it comes to reading joystick input. The MAME developers could easily implement it for joysticks and remove all signs of DirectInput if they wanted to. If it makes such a big difference, as you suggest, you have to ask yourself why they haven't already. Finally DirectInput supports calibrated joysticks while RawInput does not.
Even though it should work in theory, they haven't done it (and nobody will do it) because, unlike mice and keyboards, there are no standards for joystick data, and you don't really want to treat every gamepad generically, anyway, because they almost all have unique features. I've seen many different attempts at generic gamepad support using Raw Input, and they all seem to fail on one gamepad or another, because there's always some weird gamepad that doesn't behave the way you'd anticipate. An Xbox 360 pad is going to give you bytes in one format, and a Logitech gamepad is going to give you bytes in a different format. If you wanted to support USB gamepads with Raw Input properly, you'd have to write a byte parser that could handle basically every gamepad. At that point, you're almost writing gamepad drivers.
One gamepad's shoulder buttons might be analog whereas another gamepad's buttons might be digital. One gamepad's face buttons might be pressure sensitive whereas another gamepad's face buttons are digital. One gamepad might have force feedback and another might not. The Playstation 4 pad has a touch screen, and the 360 pad doesn't. What makes a gamepad? Which structure are you going to impose on all devices? So, like I said in the first place, there is no native way to take advantage of Raw Input with USB gamepads because there is no standard data structure for joysticks, and you'd effectively be writing per-gamepad support for each device.
There are no standards there intentionally, because unlike mice and keyboards, there are all kinds of different HIDs that manufacturers might want to make, so it doesn't make sense to impose something on them. The reason Direct Input is still being used by some software is because it gives you a standardized way to access controls across a wide variety of devices (not just XInput devices). You're basically offloading the work onto the gamepad's driver at that point (although it should be noted that not all gamepad drivers implement Direct Input the same way).
If you think you can come up with a good, generic Raw Input solution that'll work on a wide variety of gamepads, please do us all a favor and submit the implementation to MAMEdev. Personally, I don't see it happening.
Microsoft has basically left people with no choices for gamepads in a pathetic attempt to force their Xbox gamepads on everyone, and given that there are stooges in this forum (one of the places where consumers should know better) that are happy about it, apparently, Microsoft's succeeded. It's even worse if you don't have a Microsoft gamepad, because then you have to run an XInput emulator on top of everything else. So bad. Some anti-trust action needs to be taken against Microsoft again. How is it not a conflict of interest for Microsoft to effectively screw over every 3rd party gamepad manufacturer to push their own gamepads?