Hi Rafaele....
If I understood your query clearly, I strongly feel that system will only consider the header material for costing run of material A (that is valuation type blank for material B) and it doesn't consider the materials with valuation types (X, Y or Z for material B).
And I hope we can't create BOM for the in-house manufacturing products (here material A) using material B @ valuation types as quantity structure (we can use only header material).
The reason is these materials @ valuation type levels will not have COSTING tabs at all.
Please correct me if I am wrong..
Regards..
Jose