accesing com port since axapta

I want to use the mscom32.dll to manage the port com. I register that dll, but I don´t know how can call and write code from X++ to this component