To answer you question, being a former H1B myself.
You are in valid h1b status because you are working. Your employer however has violated the H1B statutes and Labor statutes by not paying you. At some point after not getting paid, and particularly finding out your company is out of funds, USCIS can reasonably infer that you were no longer employed/out of status. This situation of deferred salary cannot continue especially since it appears unlikely given the balances of the probability, that there will be funds to pay you.
You can transfer your H1B to company B however if USCIS requests pay stubs for the last three months (like they sometimes do) before approving your transfer, you can have some problems. If you can get some evidence to show you are working although you payment is being delayed, you would be fine.
You should definitely get back the money you were owed from Company A. If company A does not pay you, you can become a whistleblower to USCIS showing they have violated the H1B agreement. See:
Also Per the new H1b rules which came to effect on January 17, you will be allowed 60 days period between leaving one company and joining another during which time you are unemployed. See below
DHS proposes to generally establish a one-time grace period, during an authorized validity period, of up to 60 days whenever employment ends for individuals holding E–1, E–2, E–3, H–1B, H–1B1, L– 1, or TN nonimmigrant status. This proposal would allow these high-skilled workers to more readily pursue new employment should they be eligible for other employer-sponsored nonimmigrant classifications or for the same classification with a new employer. Conversely, the proposal allows U.S. employers to more easily facilitate changes in employment for existing or newly recruited nonimmigrant workers. The individual may not work during the grace period, unless otherwise authorized by regulation. As needed, DHS in its discretion may eliminate or shorten the 60-day period on a case-by-case basis.
You should really resolve this fast because you're more than two months without pay, and entering into problematic immigration territory.