No, you cannot create a custom class in Operation Flashpoint 2: Dragon Rising, either online or offline. You also cannot pick your own weapons before combat.
What you can do is choose from a set of preset classes online, each defined by its role in the game. For example, a Support Gunner carries a support weapon, while an AT Gunner has an anti-armor weapon, and so on.
You are also free to loot weapons from fallen soldiers and ammo crates at any time, though you often never see 80% of the guns out there. One note: I am not certain whether this applies to the PC version, but I suspect custom classes would only be possible there through a player-made mod.