Yes, You have to create NS records for the subdomain in the zone file for the main domain at company A, and then create a normal DNS zone for the subdomain at company B.
You'll need to create a ns zone (for this example I'll call it nsb). Create an A record in the zone for nsb pointing to the IP# of the second server, and an NS record pointing to that.