There is already a Mouse + Keyboard + Joystick option. Maybe just use that?
Many people have created custom descriptors, which have been discussed many times on this forum. Maybe you can find some of those conversations if you search?
If you want help with code you've tried which doesn't work, we do have a rule on this forum which you see in red text at the top of every page. Figuring out why things don't work over the internet is challenging... so please, if you want help, follow the rule and clearly show what you've actually done. Don't make us have to blind guess. We can help more if we can see the problem. We can help most if we have enough to reproduce the problem. That is the way to get the best help here.