Export stl files with C# component in GH

The method @dsonntag mentions will work nicely for all supported file extensions.
Otherwise, if you want to export meshes to OBJ in Rhino 6, you can use:
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_FileIO_FileObj_Write.htm

See this thread for an example:

Finally, writing a simple version of an STL file is not terribly complicated. I wrote Turtle a while ago, and it contains an example:

also the second link above contains a definition that already does that. Check it out!