A rigid-body model of a finger interacting with a trackball is considered. The proposed system is a suitable candidate for studying trajectory generation when interaction plays an important role, such as in assembly and manipulation tasks. The mathematical model consists of a ball with a spherical joint constraint, a finger with three degrees of freedom, and the Coulomb friction model. From first principles, we derive a hybrid, highindex differential-algebraic equation for modeling the system dynamics, which is used for both simulation and finding optimal trajectories. For this problem, task planning, path planning, and trajectory generation are strongly interrelated, which makes using an integrated approach to trajectory generation inevitable. Moreover, the trajectory generation algorithm has to handle a number of important features, e.g., unilateral and non-holonomic constraints.