I have this in a custom table form (which uses Biz Forms).  The syntax is for v7 but should work for v6 as well.
protected void customTableForm_OnAfterSave(object sender, EventArgs e)
{
    CustomTableForm ctf = (CustomTableForm)sender;
    // need to programatically get the primary key column
    IDataClass idc = DataClassFactory.NewDataClass("your.class.name");
    // get the id of the last inserted item
    int lastInsertedId = ValidationHelper.GetInteger(ctf.BasicForm.Data[idc.IDColumn], -1);
}