As far as the Gamepad API goes, it is originally a Read-Only API. Hence you could make your sensor as one which emits events
every few ticks
to hack your HID device into acting like a Gamepad.
The con of this method is that you would not be able to write back to the "sensor -> HID interface -> Gamepad Device" system via the APIs.
As long as that is not a requirement, feel free to use it in this combination.
BONUS: If you want duplex communication abilities, you might consider hosting a server on a machine that connects to the HID device and use Java/PHP/Node based serial communications protocol to read/write to the sensor.
Your frontend application where the JS is running can then poll your server via AJAX for reading/writing data.