If company A isn't going to offer you a job your visa is worthless. Frankly, I suspect they acted illegally in sponsoring that visa if it was contingent on some other contract. One, they are supposed to attesting to a need they already have and second, they're not supposed to be contracting out H1B labor.
If you can find another legal employer, you'll have to start over with them.

