How can I build the 40 hours instrument time required for an instrument rating?
The remainder of the 25 hours can be completed with a Safety Pilot, a CFI, or a CFII. 

A safety pilot must be able to act as PIC of the aircraft you are flying. Also, if the safety pilot is acting/desinated as PIC, both you and the safety pilot can log PIC time for when you are flying under the hood. If you are acting as PIC, the safety pilot can log SIC time for being a required flight crew member (FAR61.51(f)).

You cannot file an IFR flight plan or fly in IMC unless a current Instrumented Rated pilot is on board and acts as PIC.