Refer to this link. There you 'll find some guidelines regarding setting state space/bounds, using existing planners in ompl, setting start/goal states and find solution.
These are the following steps basically(for example SE2):-
//1. construct the instance of state space we are planning in->for mobile base SE2
ompl::base::StateSpacePtr space(new ompl::base::SE2StateSpace());
//2. get bounds from worldmap and set it to bounds for the planner
ompl::base::RealVectorBounds bounds(2);
space->as<ompl::base::SE2StateSpace>()->setBounds(bounds);
//3. Create an instance of ompl::geometric::SimpleSetup
ompl::geometric::SimpleSetup simple_setup(space);
//4. Set state validity checker
simple_setup.setStateValidityChecker(boost::bind(&Function_Name, this, _1));
//7. set start and goal state to planner
simple_setup.setStartAndGoalStates(ompl_scoped_state_start, ompl_scoped_state_goal);
//8 Set Planner type
ompl::base::SpaceInformationPtr si_ptr = simple_setup.getSpaceInformation();
ompl::base::PlannerPtr target_planner_ptr(new ompl::geometric::EST(si_ptr));
simple_setup.setPlanner(target_planner_ptr);
//9. Solve
simple_setup.solve(1.0);
Hope this helps.