You might be able to just say you include Product B in Product A but it will probably not reduce inventory or handle Product B the way you want.
There is an app that claims to do what you want: https://apps.shopify.com/product-bundles
I have not used it so your mileage will very.
Are you looking to keep the inventory count in sync? If so check out our App Shopify Assistant. We have a task specifically designed to synchronize inventory so that when a variant is ordered it also deducts inventory from any other variants you configure (also increments the count if the order is cancelled).