We investigate the Casimir force between a microfabricated elliptic cylinder (cylindrical lens) and a plate made of real materials. After a brief discussion of the fabrication procedure, which typically results in elliptic rather than circular cylinders, the Lifshitz-type formulas for the Casimir force and for its gradient are derived. In the specific case of equal semiaxes, the resulting formulas coincide with those derived previously for circular cylinders. The nanofabrication procedure may also result in asymmetric cylindrical lenses obtained from parts of two different cylinders, or rotated through some angle about the axis of the cylinder. In these cases the Lifshitz-type formulas for the Casimir force between a lens and a plate and for its gradient are also derived, and the influence of lens asymmetry is determined. Additionally, we obtain an expression for the shift of the natural frequency of a micromachined oscillator with an attached elliptic cylindrical lens interacting with a plate via the Casimir force in a nonlinear regime.