KeybState is an array of bytes. Each of those bytes can be toggled or not (on or off). This is indicated via the most significant bit of each byte.
That is where 0x80 comes from. In that byte value, the highest bit is 1 which means the key is 'pressed' or down.
If you set it to 0, then the most significant bit is 0, meaning 'not pressed' or up.
The order in which you attach seems correct. You don't need to send the keydown for the shift key. That is achieved via the keyboard state already unless you also want to process the setting of the shift key.
KeybState[VK_SHIFT] |= 0x80;
this will simulate the shift key being held down you don't have to postmessage the shiftkey again.
EDIT: The easiest way to test these things is simply to make a new MFC dialog project, and put such code under a button click or in the InitDialog function. That way you can immediately see the result.