In the US, company B would probably be in the clear--at least for the list of names and numbers. You don't necessarily get copyright protection just because something was a lot of work ("sweat of the brow"). The most relevant US Supreme Court case is Feist.
There is protection in a few notable jurisdictions so a violation would make the product illegal in those jurisdictions, which is a problem if it’s an online product.