The HD500 is very configurable but I don't think the HD400 is really versatile enough to use as a general purpose Midi controller.
The HD400 does not allow you to configure the MIDI messages sent when you hit footswitches. AFAIK it will send program change messages and some (fixed) midi CC messages when you change controls. Mainstage claims to be very flexible so I guess there is a possibility that you can do something but the odds are not good.
The documentation around MIDI for the HD400 is a bit limited. The advanced guide here refers to some basic sysex functions in Appendix B http://line6.com/data/6/0a060b316ac34f059389515a7/application/pdf/POD%20HD400%20Advanced%20Guide%20-%20English%20%28%20Rev%20D%20%29.pdf
The following statement is also made ...
When adjusting most POD HD controls, MIDI CC messages are sent to the POD HD USB MIDI Out port, Channel 1. It is possible to utilize the USB MIDI port to route this MIDI data to MIDI or DAW applications if desired. Further, many POD HD parameters can also be controlled remotely by receiving MIDI control messages on its USB MIDI In port, Channel 1. Details for all this MIDI functionality can be found in the additional documentation at http://line6.com/support/manuals/.
Unfortunately, AFAIK there is no additional information to be found in the manuals download section so I think that is it! You could try using a Midi Sniffer tool such as MIDI-OX to see what cc's are sent.