getbitsをVB6でコーディングするとどうなりますか?

unsigned getbits(unsigned x, int p, int n)
{
return (x >> (p + 1 - n)) & ~(~0 << n);
}

VB.netだとシフト演算子があるのですが…。