Out of curiosity... Why not just the _WinAPI_* functions already done for you?
Worse case, look at how they implemented their code for your functions versus yours.
Edit:
#1. You are trying to get the value of $pwszBuff exactly how? You didn't even make the param ByRef.
#2. You have $pwszBuff setup to receive a wstr, when it states it's a ptr
#3. Even if you had that setup right, you didn't pass a ptr.
Func _User32_ToUnicodeEx($wVirtKey, $wScanCode, $lpKeyState, ByRef $pwszBuff, $cchBuff, $wFlags, $dwhkl)
Local $vRetVal = DllCall("user32.dll", "int", "ToUnicodeEx", "UINT", $wVirtKey, "UINT", $wScanCode, "ptr", $lpKeyState, "wstr*", "", "int", $cchBuff, "UINT", $wFlags, "hwnd", $dwhkl)
If @error Then Return SetError(1, 0, 0)
$pwszBuff = $vRetVal[4]
Return $vRetVal[0]
EndFunc ;==>_User32_ToUnicodeEx
See if that does what you're looking for.