a simple union would also do

union ul
{
BYTE b[4];
ULONG result;
} ;

setting the correct bytes in b in the correct order ( according to the endianess of the machine ofc)
you can the access result as an ulong.