There's a fairly comprehensive example creating an IfcWall element/object:
https://docs.xbim.net/examples/proper-wall-in-3d.html
and the full example in Github at https://github.com/xBimTeam/XbimSamples/blob/master/HelloWall/HelloWallExample.cs
That demonstrates the creating the object and a lot more besides (including geometry). xbim Essentials lets you read and write the whole IFC schema, which can include the geometry. But if you just want to create an element it's pretty simple:
IModel model = BuildModel(); // There's a bit of bootstrapping in the example to create the base model and define an IFC Project and Building
using (var txn = model.BeginTransaction("Create Wall"))
{
var wall = model.Instances.New<IfcWallStandardCase>();
wall.Name = "A Standard rectangular wall";
// ...*snipped* everything else that create representation, placement, materials etc
txn.Commit();
return wall;
}
Then it's just a matter of adding the wall element to the structure. There's a helper for this used in the example to add the wall to the building:
using (var txn = model.BeginTransaction("Add Wall"))
{
building.AddElement(wall);
txn.Commit();
}
Lastly you'd save the model to an IFC Step file.
model.SaveAs("HelloWallIfc4.ifc", IfcStorageType.Ifc);