You can start with this and alter it as needed:
Editor editor = AcadApp.DocumentManager.MdiActiveDocument.Editor;
Database db = AcadApp.DocumentManager.MdiActiveDocument.Database;
TransMan transMgr = db.TransactionManager;
using (Transaction trans = transMgr.StartTransaction())
{
BlockTable bt = (BlockTable)trans.GetObject(db.BlockTableId, OpenMode.ForWrite);
BlockTableRecord ms = (BlockTableRecord)trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
//==================================================
// Create the polyline curve
Point3dCollection pnts = new Point3dCollection();
pnts.Add(new Point3d(0, 0, 0));
pnts.Add(new Point3d(1, 0, 0));
pnts.Add(new Point3d(2, 3, 0));
pnts.Add(new Point3d(0, 2, 0));
DoubleCollection bulges = new DoubleCollection();
bulges.Add(0.5);
bulges.Add(0.75);
bulges.Add(0.3);
bulges.Add(0.9);
Polyline2d poly2d = new Polyline2d(Poly2dType.QuadSplinePoly,
pnts, 0.0, true, 0.0, 0.0, bulges);
//==================================================
// Add the curve to a DBObjectCollection.
DBObjectCollection curveCol = new DBObjectCollection();
curveCol.Add(poly2d);
//==================================================
// Create a region collection from the curve. In this example the collection
// should only contain 1 new region
DBObjectCollection regionCol = Region.CreateFromCurves(curveCol);
Region region = (Region)regionCol[0];
//==================================================
// Create the 'extude along path' line.
Line pathLine = new Line(new Point3d(0, 0, 0), new Point3d(30, 40, 50));
//==================================================
// Create the solid.
Solid3d solid = new Solid3d();
solid.ExtrudeAlongPath(region, pathLine, 0.0);
ms.AppendEntity(solid);
trans.AddNewlyCreatedDBObject(solid, true);
poly2d.Dispose();
pathLine.Dispose();
region.Dispose();
trans.Commit();
}