Guitar > HD500 input, HD500 FX send > Mesa input, Mesa FX send > HD500 FX return, HD500 output > Mesa FX return.
In the HD500, put your pre- effects (wah, drive, fuzz) before the FX block and your post- effects (delay, reverb, chorus) after it.
No strict rules, though, of course - whatever you think sounds best is what's right for you.