STM32 USB host will not return from reset request
Since you didnot upload the whole cubemx and generated code for the project i cannot fully try to replicate and find the problem. 

But i will try to point you into few things that might/mightnot help : 

1- make sure that  global non maskable interrupts are enabled , inaddition to USB OTG gloabl interrupt. in the configuration window , NVIC tab in cubemx project. 

2- make sure you are using the correct mode , (using RTOS or standalone project , becuase the code generator may change things in RTOS mode or using DMA because DMA usually consider the interrupt as a request event). your problem might be somewhere else which is preventing write to this register, something like the lock sequence used for mapping I/O and peripherals.

3- There is 2 things called GINTMSK , a bit in OTG_FS_GAHBCFG register 



and a a register called : OTG_FS_GINTMSK



4- The correct programming sequence is used :


5- Search in smt32cube directory / projects / stm32xx discovery / applications/ 
in this folder you will find multiple projects on USB applications depending on your deivce , use these codes as starter and compare the initalization to your code.