You may use the varType()
function to test the type, alternatively if you are testing for specific types, you could use typeof.
If VarType(oCollection.Item(sKey)) = vbObject Then
Set vItem = oCollection.Item(sKey)
Else
vItem = oCollection.Item(sKey)
End If