sidclei,
I had the same issue a few days ago. Are you using a complete version of Visual Studio, or the Express Version? If you're using complete version, I believe you can't solve it by attaching to the ugraf.exe process. I think this option should be under "Debug > Attach to process"... or something like that, I'm not sure since I'm using the Express Version, and it seems that "Attach to process" is not supported for Express... Anyway, there's a workaround for this version... You need to open the project directory, and edit the .vbproj USER file. Add this code:
<PropertyGroup>
<StartAction>Program</StartAction>
<StartProgram>%UGII_BASE_DIR%\UGII\ugraf.exe</StartProgram>
</PropertyGroup>
Then you should be able to run your code. Anyway I still have some problems compiling to dll, but that's a different story hehe...