It's super simple to set up. Each set of 2 wires connects to a single switch. The controller can handle 12 buttons and 4 joystick switches. I use happ buttons and joy sticks which have different switches to the sanwa ones in the kit you showed, but the connections are the same. If you have a 5 pin joystick you use the 5 pin joystick connector in the middle top row of connectors, otherwise you wire the individual direction switchs (up down right left) to the connectors on the top right of the board. The buttons wire to the row of connectors on the bottom of the board. Button 1 connects to the bottom left most connector and button 12 connects to the bottom right most connector.
On mine I use 8 of the button connectors = button 1-6, start 1, coin 1.
In mame you need to configure the controls. I initially do it with a keyboard plugged in. I start any game, then hit tab to get the configuration menu, and then set up the UI controls so I can use the joystick to go through the menus and button 1 to select. Then I use the joystick to set the player controls for player 1 - move the joystick to the control I want to set, button 1 to tell mame to change the control and then hit the button I want the control to be. Select player 1 up, hit button 1 to tell it to change, move the joystick up, and it's set. Then do down, left right, button 1, 2,3,4,5,6, coin, and start.
I use two of these controllers, so once I set mame to use the joystick, I switch off, remove the keyboard, plug in the second controller, and then start up again, boot to mame, and set up controller 2.
I also set a multi button combination to exit the emulator. I use two of the controllers, so my exit command is start 1+start 2. On a two controller system, it's easier to wire both start and both coins to the first controller, but I did each start and coin to it's own controller. Usually each emulator has it's own way of setting up the joysticks. I only use mame in my cabs, so I haven't set the other emulators up. I like the controller though.