what i would do is calling netstat from the vb6 code using Shell and log the output to some result file, then parse it and get the information i need about the ports:
for example, for port 443:
Dim RetVal
RetVal = Shell("netstat -an | find ":443" > c:\temp\netstat.log", 1)
the output file should look something like this:
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING
TCP 172.20.1.78:37623 216.166.12.33:443 ESTABLISHED
TCP 172.20.1.78:37625 216.166.12.33:443 ESTABLISHED
TCP 172.20.1.78:37629 216.166.12.33:443 ESTABLISHED
TCP 172.20.1.78:37630 216.166.12.33:443 ESTABLISHED
TCP 172.20.1.78:37648 216.166.12.33:443 ESTABLISHED
TCP 172.20.1.78:37649 216.166.12.33:443 ESTABLISHED
TCP [::]:443 [::]:0 LISTENING