You program is incorrect. In order to read the written data, you have to (re)position the 'file pointer' at the very beginning of the file. This can simply accomplished by closing the file and then open it again for reading.
pFile = fopen ( "myfile.bin" , "wb" );
fwrite (buffer , 1 , sizeof(buffer) , pFile );
fclose(pFile);
fopen ( "myfile.bin" , "rb" );
fread(buffer,1,sizeof(buffer),pFile);
By the way: you should always check the return value of the called functions.