Hi Nandhini,
You need to create Item B as a Semi finished good i.e Default order as Production and Formula type as BOM and you need to define a seperate BOM and Route .
So technically there should be 2 production orders created:
1.For B with BOM with value added service and Raw Material(subcontracting) and process using Route with operations of Drilling,Polishing and cutting.
2.For X with BOM including A,C,D as components and B as semi finished good and Route including Assembly operation.