If Company B is holding a visa in his name Company C will not be able to get a visa for your friend. The visa taken by Company B should be cancelled.