Instructions
Craft or purchase your required items. For example, you can craft various types of scopes depending on your Engineering level, or you can craft gems for sockets if you take Alchemy. Otherwise, you must purchase these from other players through the auction house.
Press "B" to open your backpack once you obtain your required items.
Press "Shift" and left-click your crossbow if it has sockets. Drag the gems into the sockets to apply the gems' bonus.
Drag the scope onto the crossbow to attach it to the weapon, applying the scope's bonus.