How about making this a generic function?
Private Function Mode(Of T)(ByRef array As T()) As Object
'...
End Function
Or
Private Function Mode(Of T)(ByRef array As T()) As T()
'...
End Function
Then you do:
Dim obj As Object = Mode(Of Integer)({0, 1, 2, 3})
Or:
Dim obj As Integer() = Mode(Of Integer)({0, 1, 2, 3})