In this paper, we propose a method to automatically generate source code files from a use case model and a domain class diagram named USLSCG (Use case Specification Language (USL) based Code Generation). In our method, a use case scenario is precisely specified by a USL model. The USL model and the domain class diagram then are used as inputs to generate source code files automatically. These source code files include classes following three-layer applications and a SQL script file to create a database and store procedures.