You'll need to retain a business lawyer to do this right.
Even if there are two founders, most LLC's and corporations MUST be incorporated in one place...and it needn't be where either of you are located. This is why many companies are "Delaware Corporations," regardless of where they're based...I forget if that's a liability or tax loophole that causes many to do so. Wherever you incorporate is usually where all legal disputes will be settled, so that will be a major factor...the considerations are as much legal as they are economical. Payment and taxation will vary based on if you're both equity shareholders, or if one is an employee and the other the owner (happens often if one supplies more initial funding than the other). Joint ventures can work but make no mistake: It's truly like making a brand new third firm/company.
I'm positive you can make it work, but only a business attorney will help you navigate these waters and ensure success.