H1B Visa expense for internal transfer or external application.

I am working with MNC which has company A in India which has another Company B in US, Now if I join Company B in US, who has to pay my H1B expense Company A in India or Company B in US. How much is total expense Company A or Company B has to pay to get me H1B visa to go and work with Company B in US. Is there any taxation amount that Company A or Company B has to pay or beer as I am joining Company B in US. Looking for total expense including everything.

Is it possible I resign from Company A and then I apply for H1B visa to join Company B, is it possible. How much Company B has to paying this case and what will be the challanges in terms of documentation or process I have to deal with in this case.